package com.frogs.ucenter.v1.request;


import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.util.StringUtil;
import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.util.HonorTypeEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;


/**
 * 查询用户荣誉列表参数类
 *
 * @author jzkangta
 */
public class UserHonorListRequest extends Request {
	/**
	 * 
	 */
	private static final long serialVersionUID = 7691622063232650473L;
	private Integer userId = 0;//蛙鸣用户id
	private Integer honorType = -1;
	 private Integer openPlatformId = -1;
	
	 
	
	public UserHonorListRequest() {
		
	}
	
	@Override
	public void parse(HttpServletRequest request) {
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		this.userId = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), 0);
		this.honorType = requestInfo.getIntParameter(ApiUrlParamEnum.honorType.getParamName(), HonorTypeEnum.XIAO_XIN.getId());
		this.openPlatformId = requestInfo.getIntParameter(ApiUrlParamEnum.openPlatformId.getParamName(), -1);
		if(userId == 0 ) {
			throw new RequestIllegalException("传递错误的参数，请确认userId不能为空!");
		}
		if(honorType < 0 ) {
			throw new RequestIllegalException("传递错误的参数，请确认honorType不能为空!");
		}
		
		if(openPlatformId < 0 ) {
			throw new RequestIllegalException("传递错误的参数，请确认openPlatformId不能为空!");
		}
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public Integer getHonorType() {
		return honorType;
	}

	public void setHonorType(Integer honorType) {
		this.honorType = honorType;
	}


	public Integer getOpenPlatformId() {
		return openPlatformId;
	}

	public void setOpenPlatformId(Integer openPlatformId) {
		this.openPlatformId = openPlatformId;
	}

	
	
}
